<mat-sidenav-container
    class="example-container" (backdropClick)="close('backdrop')" *ngIf="shouldRun">
  <mat-sidenav #sidenav (keydown.escape)="close('escape')" disableClose>
    <p><button mat-button (click)="close('toggle button')">Toggle</button></p>
  </mat-sidenav>

  <mat-sidenav-content>
    <p><button mat-button (click)="sidenav.open()">Open</button></p>
    <p>Closed due to: {{reason}}</p>
  </mat-sidenav-content>
</mat-sidenav-container>

<div *ngIf="!shouldRun">Please open on Stackblitz to see result</div>
